Skip to main content

Ubuntu 安装

apt-get update && apt-get install -y apt-transport-https




curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add -



cat <<EOF >/etc/apt/sources.list.d/kubernetes.list

deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main

EOF



apt-get update


apt-get install -y kubelet kubeadm kubectl

下载安装包

比如下载kubectl 

curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.10.3/bin/linux/amd64/kubectl







kubeadm init --kubernetes-version=v1.12.1 --pod-network-cidr=10.244.0.0/16 --service-cidr=10.96.0.0/12 --ignore-preflight-errors=Swap



运行报错

[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.12.1: output: Error response from daemon: Get https://k8s.gcr.io/v1/_ping: dial tcp 108.177.125.82:443: i/o timeout

, error: exit status 1

[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-controller-manager:v1.12.1: output: Error response from daemon: Get https://k8s.gcr.io/v1/_ping: dial tcp 108.177.125.82:443: i/o timeout

, error: exit status 1

[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-scheduler:v1.12.1: output: Error response from daemon: Get https://k8s.gcr.io/v1/_ping: dial tcp 108.177.125.82:443: i/o timeout

, error: exit status 1

[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-proxy:v1.12.1: output: Error response from daemon: Get https://k8s.gcr.io/v1/_ping: dial tcp 108.177.125.82:443: i/o timeout

, error: exit status 1

[ERROR ImagePull]: failed to pull image k8s.gcr.io/pause:3.1: output: Error response from daemon: Get https://k8s.gcr.io/v1/_ping: dial tcp 108.177.125.82:443: i/o timeout

, error: exit status 1

[ERROR ImagePull]: failed to pull image k8s.gcr.io/etcd:3.2.24: output: Error response from daemon: Get https://k8s.gcr.io/v1/_ping: dial tcp 108.177.125.82:443: i/o timeout

, error: exit status 1

[ERROR ImagePull]: failed to pull image k8s.gcr.io/coredns:1.2.2: output: Error response from daemon: Get https://k8s.gcr.io/v1/_ping: dial tcp 108.177.97.82:443: i/o timeout

, error: exit status 1

docker pull mirrorgooglecontainers/kube-apiserver-amd64:v1.12.1

docker pull mirrorgooglecontainers/kube-controller-manager-amd64:v1.12.1

docker pull mirrorgooglecontainers/kube-scheduler-amd64:v1.12.1

docker pull mirrorgooglecontainers/kube-proxy-amd64:v1.12.1

docker pull mirrorgooglecontainers/pause:3.1

docker pull mirrorgooglecontainers/etcd-amd64:3.2.18

docker pull coredns/coredns:1.1.3